// 注意，不要使用app实例，调用生命周期函数
const appInstance = getApp()

Page({
  data: {
    avatarUrl: '../../assets/shasha.jpg'
  },
  chooseavatar(event) {
    this.setData({
      avatarUrl: event.detail.avatarUrl
    })
  },
  getNickname(event) {
    console.log(event.detail.value)
  },
  getPhoneNumber(event){
    console.log(event)
  },
  getRealtimePhoneNumber(event){
    console.log(event)
  },
  // 模拟登录
  handleLogin(){
    let token = '3131'
    console.log(appInstance)
    appInstance.setToken(token)
  }
})